var mongoose = require('mongoose')

var EmotionSchema = new mongoose.Schema({
    // tester:String,
    timeline:String,
    unhappy:Number,
    happy:Number,
    surprise:Number,
})


EmotionSchema.pre('save',function(next){

    next()
})


EmotionSchema.statics = {
    fetch:function(cb){
        return this
            .find({})
            .sort('timeline')
            .exec(cb)
    },
    findById:function(id,cb){
        return this
        .findOne({_id:id})
        .exec(cb)
    }
}

module.exports = EmotionSchema
